Skip to content

Conversation

srikg20
Copy link

@srikg20 srikg20 commented Jun 15, 2025

No description provided.

@@ -6,38 +6,42 @@
## This function computes the median of the special "matrix" returned by makeCacheMatrix.

makeCacheMatrix <- function(x = matrix()) {
m <- NULL

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of mean , calculate inverse

m <<- NULL
}
get <- function() x
setmedian <- function(median) m <<- median

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setInverse<-function() inv<<-solve(x)


  # If not cached, compute the inverse
  mat <- x$get()         # Get the matrix
  inv <- solve(mat, ...) # Compute the inverse using solve()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calculate inverse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants